import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['svg.fonttype'] = 'none'

# 创建数据框架
data = {
    'Node Nums': [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
    'SPS': [0.996264029,0.996408612,0.997324659,0.998827922,0.996655358,0.998421999,0.999052718,0.99939344,0.999350006,0.998179712,0.999017214],
    'OGS': [0.981402684,0.905120234,0.91310229,0.928065362,0.966975696,0.97669955,0.988866681,0.972855654,0.988880071,0.977065521,0.988432638],
    'ORDP': [0.996305162,0.987102303,0.997615544,0.998674515,0.999372842,0.997751745,0.99852698,0.999421509,0.9990905,0.998416556,0.99906463],
}

df = pd.DataFrame(data)

# 绘制数据
plt.figure(figsize=(8, 6))
plt.plot(df['Node Nums'], df['SPS'], marker='s', markersize=10, label='SPS')
plt.plot(df['Node Nums'], df['OGS'], marker='^', markersize=10, label='OGS')
plt.plot(df['Node Nums'], df['ORDP'], marker='*', markersize=10, label='ORDP')

# plt.title('Comparison of SPF and Cplex Algorithms')
plt.xlabel('Number of Nodes', fontsize=14)
plt.ylabel('Jain\'s Index', fontsize=14)
plt.legend(fontsize='large')  # 设置图例的字体大小为大

plt.grid(True)
# plt.show()
plt.savefig("plot_incluster_jain.svg", format="svg")
